<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button id="mybutton">按钮1</button><br>
</body>
</html>

<script type="text/javascript">
    function method01(){
        alert('动态绑定');
    }
    //步骤1：获取网页中的按钮标签
    var elementButton=document.getElementById('mybutton');
    //步骤2：设置按钮标签单击事件的绑定函数
    elementButton.onclick=method01;
</script>